package com.Test;

import com.Util.Window;

import javax.swing.*;
import javax.swing.plaf.ComboBoxUI;
import javax.swing.plaf.basic.BasicComboBoxUI;


public class Test1 {
    public static void main(String[] args) {
        JFrame jf=new Window().window("测试下拉框",200,300,300,200);
        JPanel jPanel=new JPanel();
        JComboBox<String> jComboBox=new JComboBox<>();
        jComboBox.addItem("贵州");
        jComboBox.addItem("云南");
        jComboBox.addItem("四川");
        jComboBox.addItem("重庆");
        jComboBox.addActionListener(e-> System.out.println(jComboBox.getSelectedItem().toString()));
        JPanel jp2=new JPanel();
        jp2.add(jComboBox);

        String[] ans={"贵州","云南","四川","重庆"};
        ComboBoxUI comboBoxUI=new BasicComboBoxUI();
        jComboBox.setUI(comboBoxUI);


        jf.add(jp2);




        jf.setVisible(true);
    }
}
